//==========================================================
// 此代码由TilverNET代码生成工具自动生成，请不要修改
// 代码生成器版本号：1.2
// 作者：landy
// 联系方式：(QQ)86566178
// 创建时间：2014/8/22 11:23:39
//==========================================================

using System;
using System.Text;
using System.Data;
using System.Data.Common;
using System.Collections.Generic;
using System.Linq;
using Tilver.Data;
using Tilver.Data.DataPager;

namespace Weixin.MP.DAL.CoWeixin
{
	#region EO

	/// <summary>
	///  《dbo.用户管理(实体类)》
	/// </summary>
	[Serializable]
	public class Coder用户管理EO : IRowMapper<Coder用户管理EO>
	{
		protected long _iD;
		protected string _coder用户;
		protected string _coder密码;
		protected string _coder省市;
		protected string _coder地市;
		protected string _coder县域;
		protected string _coder站名;
		protected string _coder站号;
		protected double? _coder东经;
		protected double? _coder北纬;
		protected double? _coder高度;
		protected double? _coder东经1;
		protected double? _coder北纬1;


		/// <summary>
		///  《[字段]  [bigint]》
		/// </summary>
		public long ID
		{
			get { return _iD; }
			set { _iD = value;}
		}

		/// <summary>
		///  《[字段]  [varchar]》
		/// </summary>
		public string Coder用户
		{
			get { return _coder用户; }
			set { _coder用户 = value;}
		}

		/// <summary>
		///  《[字段]  [varchar]》
		/// </summary>
		public string Coder密码
		{
			get { return _coder密码; }
			set { _coder密码 = value;}
		}

		/// <summary>
		///  《[字段]  [varchar]》
		/// </summary>
		public string Coder省市
		{
			get { return _coder省市; }
			set { _coder省市 = value;}
		}

		/// <summary>
		///  《[字段]  [varchar]》
		/// </summary>
		public string Coder地市
		{
			get { return _coder地市; }
			set { _coder地市 = value;}
		}

		/// <summary>
		///  《[字段]  [varchar]》
		/// </summary>
		public string Coder县域
		{
			get { return _coder县域; }
			set { _coder县域 = value;}
		}

		/// <summary>
		///  《[字段]  [varchar]》
		/// </summary>
		public string Coder站名
		{
			get { return _coder站名; }
			set { _coder站名 = value;}
		}

		/// <summary>
		///  《[字段]  [varchar]》
		/// </summary>
		public string Coder站号
		{
			get { return _coder站号; }
			set { _coder站号 = value;}
		}

		/// <summary>
		///  《[字段]  [float]》
		/// </summary>
		public double? Coder东经
		{
			get { return _coder东经; }
			set { _coder东经 = value;}
		}

		/// <summary>
		///  《[字段]  [float]》
		/// </summary>
		public double? Coder北纬
		{
			get { return _coder北纬; }
			set { _coder北纬 = value;}
		}

		/// <summary>
		///  《[字段]  [float]》
		/// </summary>
		public double? Coder高度
		{
			get { return _coder高度; }
			set { _coder高度 = value;}
		}

		/// <summary>
		///  《[字段]  [float]》
		/// </summary>
		public double? Coder东经1
		{
			get { return _coder东经1; }
			set { _coder东经1 = value;}
		}

		/// <summary>
		///  《[字段]  [float]》
		/// </summary>
		public double? Coder北纬1
		{
			get { return _coder北纬1; }
			set { _coder北纬1 = value;}
		}

		/// <summary>
		/// 默认构造函数
		/// </summary>
		public Coder用户管理EO() 
		{
			Coder用户 = string.Empty;
			Coder密码 = string.Empty;
			Coder省市 = string.Empty;
			Coder地市 = string.Empty;
			Coder县域 = string.Empty;
			Coder站名 = string.Empty;
			Coder站号 = string.Empty;
		}

		/// <summary>
		/// 自定义构造函数
		/// </summary>
		/// <param name = "iD"></param>
		/// <param name = "coder用户"></param>
		/// <param name = "coder密码"></param>
		/// <param name = "coder省市"></param>
		/// <param name = "coder地市"></param>
		/// <param name = "coder县域"></param>
		/// <param name = "coder站名"></param>
		/// <param name = "coder站号"></param>
		/// <param name = "coder东经"></param>
		/// <param name = "coder北纬"></param>
		/// <param name = "coder高度"></param>
		/// <param name = "coder东经1"></param>
		/// <param name = "coder北纬1"></param>
		public Coder用户管理EO(long iD, string coder用户, string coder密码, string coder省市, string coder地市, string coder县域, string coder站名, string coder站号, double? coder东经, double? coder北纬, double? coder高度, double? coder东经1, double? coder北纬1) 
		{
			_iD = iD;
			_coder用户 = coder用户;
			_coder密码 = coder密码;
			_coder省市 = coder省市;
			_coder地市 = coder地市;
			_coder县域 = coder县域;
			_coder站名 = coder站名;
			_coder站号 = coder站号;
			_coder东经 = coder东经;
			_coder北纬 = coder北纬;
			_coder高度 = coder高度;
			_coder东经1 = coder东经1;
			_coder北纬1 = coder北纬1;
		}


		/// <summary>
		/// 将结果集映射成实体对象
		/// </summary>
		/// <param name = "reader">只进结果集流</param>
		/// <return></return>
		public Coder用户管理EO MapRow(IDataReader reader)
		{
			var ret = new Coder用户管理EO();
			ret.ID = (long)reader["ID"];
			ret.Coder用户 = (string)reader["用户"];
			ret.Coder密码 = (string)reader["密码"];
			ret.Coder省市 = (string)reader["省市"];
			ret.Coder地市 = (string)reader["地市"];
			ret.Coder县域 = (string)reader["县域"];
			ret.Coder站名 = (string)reader["站名"];
			ret.Coder站号 = (string)reader["站号"];
			ret.Coder东经 = (reader["东经"] is DBNull) ? null : (double?)reader["东经"];
			ret.Coder北纬 = (reader["北纬"] is DBNull) ? null : (double?)reader["北纬"];
			ret.Coder高度 = (reader["高度"] is DBNull) ? null : (double?)reader["高度"];
			ret.Coder东经1 = (reader["东经1"] is DBNull) ? null : (double?)reader["东经1"];
			ret.Coder北纬1 = (reader["北纬1"] is DBNull) ? null : (double?)reader["北纬1"];
			return ret;
		}

		/// <summary>
		/// 将结果集映射成实体对象，返回映射方法
		/// </summary>
		/// <return></return>
		public Func<IDataReader, Coder用户管理EO> GetMapper()
		{
			return MapRow;
		}


	}


	#endregion
	#region MO

	/// <summary>
	///  《dbo.用户管理(逻辑类)》
	/// </summary>
	public class Coder用户管理MO : DbManagerBase
	{

		#region 构造函数
		/// <summary>
		/// 构造函数
		/// </summary>
		/// <param name = "routeData">路由数据</param>
		public Coder用户管理MO(object routeData = null) : base(routeData) { }

		/// <summary>
		/// 构造函数
		/// </summary>
		/// <param name = "connectionStringName">连接字符串名称</param>
		public Coder用户管理MO(string connectionStringName) : base(connectionStringName) { }

		#endregion

		#region 私有方法
		/// <summary>
		/// 数据库访问操作方法
		/// </summary>
		/// <param name = "sql">SQL语句</param>
		/// <return>返回数据操作对象</return>
		private DbAdoBase AdoBase(string sql)
		{
			return DataBase.CreateDbAdo(sql, CommandType.Text);
		}

		#endregion

		#region Select方法集合

		/// <summary>
		/// 按字段查询
		/// </summary>
		/// <param name = "iD"></param>
		/// <param name = "top">获取记录数，当top值小于或等于0时忽略top条件</param>
		/// <param name = "sort">排序表达式，如：field1 ASC,field2 DESC</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public List<Coder用户管理EO> SelectByID(long iD, int top, string sort, TransactionManager tm = null)
		{
			var sql = new StringBuilder();
			var format = new StringBuilder();
			format.Append(@"SELECT {0} [ID], [用户], [密码], [省市], [地市], [县域], [站名], [站号], [东经], [北纬], [高度], [东经1], [北纬1] FROM [dbo].[用户管理] WHERE [ID]=@ID");
			if (!string.IsNullOrEmpty(sort)) format.AppendFormat(" ORDER BY {0} ", sort);
			sql.AppendFormat(format.ToString(), (top > 0) ? string.Format("TOP {0}", top) : string.Empty);
			return AdoBase(sql.ToString())
							.AddInParameter("@ID", iD, DbType.Int64, 8)
							.ExecuteList(new Coder用户管理EO().GetMapper(), tm);
		}
		/// <summary>
		/// 按字段查询
		/// </summary>
		/// <param name = "coder用户"></param>
		/// <param name = "top">获取记录数，当top值小于或等于0时忽略top条件</param>
		/// <param name = "sort">排序表达式，如：field1 ASC,field2 DESC</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public List<Coder用户管理EO> SelectByCoder用户(string coder用户, int top, string sort, TransactionManager tm = null)
		{
			var sql = new StringBuilder();
			var format = new StringBuilder();
			format.Append(@"SELECT {0} [ID], [用户], [密码], [省市], [地市], [县域], [站名], [站号], [东经], [北纬], [高度], [东经1], [北纬1] FROM [dbo].[用户管理] WHERE [用户]=@Coder用户");
			if (!string.IsNullOrEmpty(sort)) format.AppendFormat(" ORDER BY {0} ", sort);
			sql.AppendFormat(format.ToString(), (top > 0) ? string.Format("TOP {0}", top) : string.Empty);
			return AdoBase(sql.ToString())
							.AddInParameter("@Coder用户", coder用户, DbType.AnsiString, 50)
							.ExecuteList(new Coder用户管理EO().GetMapper(), tm);
		}
		/// <summary>
		/// 按字段查询
		/// </summary>
		/// <param name = "coder密码"></param>
		/// <param name = "top">获取记录数，当top值小于或等于0时忽略top条件</param>
		/// <param name = "sort">排序表达式，如：field1 ASC,field2 DESC</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public List<Coder用户管理EO> SelectByCoder密码(string coder密码, int top, string sort, TransactionManager tm = null)
		{
			var sql = new StringBuilder();
			var format = new StringBuilder();
			format.Append(@"SELECT {0} [ID], [用户], [密码], [省市], [地市], [县域], [站名], [站号], [东经], [北纬], [高度], [东经1], [北纬1] FROM [dbo].[用户管理] WHERE [密码]=@Coder密码");
			if (!string.IsNullOrEmpty(sort)) format.AppendFormat(" ORDER BY {0} ", sort);
			sql.AppendFormat(format.ToString(), (top > 0) ? string.Format("TOP {0}", top) : string.Empty);
			return AdoBase(sql.ToString())
							.AddInParameter("@Coder密码", coder密码, DbType.AnsiString, 50)
							.ExecuteList(new Coder用户管理EO().GetMapper(), tm);
		}
		/// <summary>
		/// 按字段查询
		/// </summary>
		/// <param name = "coder省市"></param>
		/// <param name = "top">获取记录数，当top值小于或等于0时忽略top条件</param>
		/// <param name = "sort">排序表达式，如：field1 ASC,field2 DESC</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public List<Coder用户管理EO> SelectByCoder省市(string coder省市, int top, string sort, TransactionManager tm = null)
		{
			var sql = new StringBuilder();
			var format = new StringBuilder();
			format.Append(@"SELECT {0} [ID], [用户], [密码], [省市], [地市], [县域], [站名], [站号], [东经], [北纬], [高度], [东经1], [北纬1] FROM [dbo].[用户管理] WHERE [省市]=@Coder省市");
			if (!string.IsNullOrEmpty(sort)) format.AppendFormat(" ORDER BY {0} ", sort);
			sql.AppendFormat(format.ToString(), (top > 0) ? string.Format("TOP {0}", top) : string.Empty);
			return AdoBase(sql.ToString())
							.AddInParameter("@Coder省市", coder省市, DbType.AnsiString, 50)
							.ExecuteList(new Coder用户管理EO().GetMapper(), tm);
		}
		/// <summary>
		/// 按字段查询
		/// </summary>
		/// <param name = "coder地市"></param>
		/// <param name = "top">获取记录数，当top值小于或等于0时忽略top条件</param>
		/// <param name = "sort">排序表达式，如：field1 ASC,field2 DESC</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public List<Coder用户管理EO> SelectByCoder地市(string coder地市, int top, string sort, TransactionManager tm = null)
		{
			var sql = new StringBuilder();
			var format = new StringBuilder();
			format.Append(@"SELECT {0} [ID], [用户], [密码], [省市], [地市], [县域], [站名], [站号], [东经], [北纬], [高度], [东经1], [北纬1] FROM [dbo].[用户管理] WHERE [地市]=@Coder地市");
			if (!string.IsNullOrEmpty(sort)) format.AppendFormat(" ORDER BY {0} ", sort);
			sql.AppendFormat(format.ToString(), (top > 0) ? string.Format("TOP {0}", top) : string.Empty);
			return AdoBase(sql.ToString())
							.AddInParameter("@Coder地市", coder地市, DbType.AnsiString, 50)
							.ExecuteList(new Coder用户管理EO().GetMapper(), tm);
		}
		/// <summary>
		/// 按字段查询
		/// </summary>
		/// <param name = "coder县域"></param>
		/// <param name = "top">获取记录数，当top值小于或等于0时忽略top条件</param>
		/// <param name = "sort">排序表达式，如：field1 ASC,field2 DESC</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public List<Coder用户管理EO> SelectByCoder县域(string coder县域, int top, string sort, TransactionManager tm = null)
		{
			var sql = new StringBuilder();
			var format = new StringBuilder();
			format.Append(@"SELECT {0} [ID], [用户], [密码], [省市], [地市], [县域], [站名], [站号], [东经], [北纬], [高度], [东经1], [北纬1] FROM [dbo].[用户管理] WHERE [县域]=@Coder县域");
			if (!string.IsNullOrEmpty(sort)) format.AppendFormat(" ORDER BY {0} ", sort);
			sql.AppendFormat(format.ToString(), (top > 0) ? string.Format("TOP {0}", top) : string.Empty);
			return AdoBase(sql.ToString())
							.AddInParameter("@Coder县域", coder县域, DbType.AnsiString, 50)
							.ExecuteList(new Coder用户管理EO().GetMapper(), tm);
		}
		/// <summary>
		/// 按字段查询
		/// </summary>
		/// <param name = "coder站名"></param>
		/// <param name = "top">获取记录数，当top值小于或等于0时忽略top条件</param>
		/// <param name = "sort">排序表达式，如：field1 ASC,field2 DESC</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public List<Coder用户管理EO> SelectByCoder站名(string coder站名, int top, string sort, TransactionManager tm = null)
		{
			var sql = new StringBuilder();
			var format = new StringBuilder();
			format.Append(@"SELECT {0} [ID], [用户], [密码], [省市], [地市], [县域], [站名], [站号], [东经], [北纬], [高度], [东经1], [北纬1] FROM [dbo].[用户管理] WHERE [站名]=@Coder站名");
			if (!string.IsNullOrEmpty(sort)) format.AppendFormat(" ORDER BY {0} ", sort);
			sql.AppendFormat(format.ToString(), (top > 0) ? string.Format("TOP {0}", top) : string.Empty);
			return AdoBase(sql.ToString())
							.AddInParameter("@Coder站名", coder站名, DbType.AnsiString, 50)
							.ExecuteList(new Coder用户管理EO().GetMapper(), tm);
		}
		/// <summary>
		/// 按字段查询
		/// </summary>
		/// <param name = "coder站号"></param>
		/// <param name = "top">获取记录数，当top值小于或等于0时忽略top条件</param>
		/// <param name = "sort">排序表达式，如：field1 ASC,field2 DESC</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public List<Coder用户管理EO> SelectByCoder站号(string coder站号, int top, string sort, TransactionManager tm = null)
		{
			var sql = new StringBuilder();
			var format = new StringBuilder();
			format.Append(@"SELECT {0} [ID], [用户], [密码], [省市], [地市], [县域], [站名], [站号], [东经], [北纬], [高度], [东经1], [北纬1] FROM [dbo].[用户管理] WHERE [站号]=@Coder站号");
			if (!string.IsNullOrEmpty(sort)) format.AppendFormat(" ORDER BY {0} ", sort);
			sql.AppendFormat(format.ToString(), (top > 0) ? string.Format("TOP {0}", top) : string.Empty);
			return AdoBase(sql.ToString())
							.AddInParameter("@Coder站号", coder站号, DbType.AnsiString, 50)
							.ExecuteList(new Coder用户管理EO().GetMapper(), tm);
		}
		/// <summary>
		/// 按字段查询
		/// </summary>
		/// <param name = "coder东经"></param>
		/// <param name = "top">获取记录数，当top值小于或等于0时忽略top条件</param>
		/// <param name = "sort">排序表达式，如：field1 ASC,field2 DESC</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public List<Coder用户管理EO> SelectByCoder东经(double? coder东经, int top, string sort, TransactionManager tm = null)
		{
			var sql = new StringBuilder();
			var format = new StringBuilder();
			format.Append(@"SELECT {0} [ID], [用户], [密码], [省市], [地市], [县域], [站名], [站号], [东经], [北纬], [高度], [东经1], [北纬1] FROM [dbo].[用户管理] WHERE [东经]=@Coder东经");
			if (!string.IsNullOrEmpty(sort)) format.AppendFormat(" ORDER BY {0} ", sort);
			sql.AppendFormat(format.ToString(), (top > 0) ? string.Format("TOP {0}", top) : string.Empty);
			return AdoBase(sql.ToString())
							.AddInParameter("@Coder东经", coder东经, DbType.Double, 8)
							.ExecuteList(new Coder用户管理EO().GetMapper(), tm);
		}
		/// <summary>
		/// 按字段查询
		/// </summary>
		/// <param name = "coder北纬"></param>
		/// <param name = "top">获取记录数，当top值小于或等于0时忽略top条件</param>
		/// <param name = "sort">排序表达式，如：field1 ASC,field2 DESC</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public List<Coder用户管理EO> SelectByCoder北纬(double? coder北纬, int top, string sort, TransactionManager tm = null)
		{
			var sql = new StringBuilder();
			var format = new StringBuilder();
			format.Append(@"SELECT {0} [ID], [用户], [密码], [省市], [地市], [县域], [站名], [站号], [东经], [北纬], [高度], [东经1], [北纬1] FROM [dbo].[用户管理] WHERE [北纬]=@Coder北纬");
			if (!string.IsNullOrEmpty(sort)) format.AppendFormat(" ORDER BY {0} ", sort);
			sql.AppendFormat(format.ToString(), (top > 0) ? string.Format("TOP {0}", top) : string.Empty);
			return AdoBase(sql.ToString())
							.AddInParameter("@Coder北纬", coder北纬, DbType.Double, 8)
							.ExecuteList(new Coder用户管理EO().GetMapper(), tm);
		}
		/// <summary>
		/// 按字段查询
		/// </summary>
		/// <param name = "coder高度"></param>
		/// <param name = "top">获取记录数，当top值小于或等于0时忽略top条件</param>
		/// <param name = "sort">排序表达式，如：field1 ASC,field2 DESC</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public List<Coder用户管理EO> SelectByCoder高度(double? coder高度, int top, string sort, TransactionManager tm = null)
		{
			var sql = new StringBuilder();
			var format = new StringBuilder();
			format.Append(@"SELECT {0} [ID], [用户], [密码], [省市], [地市], [县域], [站名], [站号], [东经], [北纬], [高度], [东经1], [北纬1] FROM [dbo].[用户管理] WHERE [高度]=@Coder高度");
			if (!string.IsNullOrEmpty(sort)) format.AppendFormat(" ORDER BY {0} ", sort);
			sql.AppendFormat(format.ToString(), (top > 0) ? string.Format("TOP {0}", top) : string.Empty);
			return AdoBase(sql.ToString())
							.AddInParameter("@Coder高度", coder高度, DbType.Double, 8)
							.ExecuteList(new Coder用户管理EO().GetMapper(), tm);
		}
		/// <summary>
		/// 按字段查询
		/// </summary>
		/// <param name = "coder东经1"></param>
		/// <param name = "top">获取记录数，当top值小于或等于0时忽略top条件</param>
		/// <param name = "sort">排序表达式，如：field1 ASC,field2 DESC</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public List<Coder用户管理EO> SelectByCoder东经1(double? coder东经1, int top, string sort, TransactionManager tm = null)
		{
			var sql = new StringBuilder();
			var format = new StringBuilder();
			format.Append(@"SELECT {0} [ID], [用户], [密码], [省市], [地市], [县域], [站名], [站号], [东经], [北纬], [高度], [东经1], [北纬1] FROM [dbo].[用户管理] WHERE [东经1]=@Coder东经1");
			if (!string.IsNullOrEmpty(sort)) format.AppendFormat(" ORDER BY {0} ", sort);
			sql.AppendFormat(format.ToString(), (top > 0) ? string.Format("TOP {0}", top) : string.Empty);
			return AdoBase(sql.ToString())
							.AddInParameter("@Coder东经1", coder东经1, DbType.Double, 8)
							.ExecuteList(new Coder用户管理EO().GetMapper(), tm);
		}
		/// <summary>
		/// 按字段查询
		/// </summary>
		/// <param name = "coder北纬1"></param>
		/// <param name = "top">获取记录数，当top值小于或等于0时忽略top条件</param>
		/// <param name = "sort">排序表达式，如：field1 ASC,field2 DESC</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public List<Coder用户管理EO> SelectByCoder北纬1(double? coder北纬1, int top, string sort, TransactionManager tm = null)
		{
			var sql = new StringBuilder();
			var format = new StringBuilder();
			format.Append(@"SELECT {0} [ID], [用户], [密码], [省市], [地市], [县域], [站名], [站号], [东经], [北纬], [高度], [东经1], [北纬1] FROM [dbo].[用户管理] WHERE [北纬1]=@Coder北纬1");
			if (!string.IsNullOrEmpty(sort)) format.AppendFormat(" ORDER BY {0} ", sort);
			sql.AppendFormat(format.ToString(), (top > 0) ? string.Format("TOP {0}", top) : string.Empty);
			return AdoBase(sql.ToString())
							.AddInParameter("@Coder北纬1", coder北纬1, DbType.Double, 8)
							.ExecuteList(new Coder用户管理EO().GetMapper(), tm);
		}

		/// <summary>
		/// 按自定义条件查询
		/// </summary>
		/// <param name = "where">自定义条件,where子句</param>
		/// <param name = "top">获取行数</param>
		/// <param name = "sort">排序表达式</param>
		/// <param name = "paras">where子句中定义的参数集合</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public List<Coder用户管理EO> Select(string where, int top, string sort, IEnumerable<DbParameter> paras, TransactionManager tm = null)
		{
			var sql = new StringBuilder();
			var format = new StringBuilder();
			format.Append(@"SELECT {0} [ID], [用户], [密码], [省市], [地市], [县域], [站名], [站号], [东经], [北纬], [高度], [东经1], [北纬1] FROM [dbo].[用户管理] ");
			if (!string.IsNullOrEmpty(where)) format.AppendFormat(" WHERE {0} ", where);
			if (!string.IsNullOrEmpty(sort)) format.AppendFormat(" ORDER BY {0} ", sort);
			sql.AppendFormat(format.ToString(), (top > 0) ? string.Format("TOP {0}", top) : string.Empty);
			return AdoBase(sql.ToString())
							.AddParameters(paras)
							.ExecuteList(new Coder用户管理EO().GetMapper(), tm);
		}

		/// <summary>
		/// 分页查询
		/// </summary>
		/// <param name = "where">条件表达式</param>
		/// <param name = "sort">排序表达式</param>
		/// <param name = "paras">传入参数</param>
		/// <param name = "pageSize">页大小</param>
		/// <param name = "pageIndex">页码</param>
		/// <param name = "recordCount">总记录数，由于计算总记录数影响数据库性能，只有小于或等于0的情况下才返回总记录数</param>
		/// <return>分页数据</return>
		public List<Coder用户管理EO> SelectPager(string where, string sort, IList<DbParameter> paras, long pageSize, long pageIndex, ref long recordCount)
		{
			var sql = new StringBuilder();
			sql.AppendFormat(@"SELECT [ID], [用户], [密码], [省市], [地市], [县域], [站名], [站号], [东经], [北纬], [高度], [东经1], [北纬1] FROM [dbo].[用户管理]");
			if (!string.IsNullOrEmpty(where)) sql.AppendFormat(" WHERE {0} ", where);
			if (!string.IsNullOrEmpty(sort)) sql.AppendFormat(" ORDER BY {0} ", sort);
			var pager = this.DataBase.CreatePager(sql.ToString(), pageSize);
			pager.AddParameters(paras);
			if (recordCount <= 0)
			{
				recordCount = pager.GetRecordCount();
			}
			return pager.GetPageData(pageIndex).MapToList(new Coder用户管理EO().GetMapper());
		}

		#endregion

		#region Insert方法集合
		/// <summary>
		/// 插入数据，有自增列时，item中自增字段为新增值，否则，返回影响的行数
		/// </summary>
		/// <param name="tm">事务管理对象</param>
		/// <param name = "item">要插入的实体对象</param>
		/// <return></return>
		public int Insert(Coder用户管理EO item, TransactionManager tm = null)
		{
			const string sql = @"INSERT INTO [dbo].[用户管理] ([ID], [用户], [密码], [省市], [地市], [县域], [站名], [站号], [东经], [北纬], [高度], [东经1], [北纬1]) VALUES (@ID, @用户, @密码, @省市, @地市, @县域, @站名, @站号, @东经, @北纬, @高度, @东经1, @北纬1) ";
			return AdoBase(sql)
												.AddInParameter("@ID", item.ID, DbType.Int64, 8)
												.AddInParameter("@用户", item.Coder用户, DbType.AnsiString, 50)
												.AddInParameter("@密码", item.Coder密码, DbType.AnsiString, 50)
												.AddInParameter("@省市", item.Coder省市, DbType.AnsiString, 50)
												.AddInParameter("@地市", item.Coder地市, DbType.AnsiString, 50)
												.AddInParameter("@县域", item.Coder县域, DbType.AnsiString, 50)
												.AddInParameter("@站名", item.Coder站名, DbType.AnsiString, 50)
												.AddInParameter("@站号", item.Coder站号, DbType.AnsiString, 50)
												.AddInParameter("@东经", item.Coder东经.HasValue ? (object)item.Coder东经.Value : DBNull.Value, DbType.Double, 8)
												.AddInParameter("@北纬", item.Coder北纬.HasValue ? (object)item.Coder北纬.Value : DBNull.Value, DbType.Double, 8)
												.AddInParameter("@高度", item.Coder高度.HasValue ? (object)item.Coder高度.Value : DBNull.Value, DbType.Double, 8)
												.AddInParameter("@东经1", item.Coder东经1.HasValue ? (object)item.Coder东经1.Value : DBNull.Value, DbType.Double, 8)
												.AddInParameter("@北纬1", item.Coder北纬1.HasValue ? (object)item.Coder北纬1.Value : DBNull.Value, DbType.Double, 8)
												.ExecuteNonQuery(tm);
		}
		#endregion

		#region Update方法集合
		/// <summary>
		/// 按自定义条件更新数据
		/// </summary>
		/// <param name = "set">更新列</param>
		/// <param name = "where">更新条件</param>
		/// <param name = "paras">参数集合</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public int Update(string set, string where, IEnumerable<DbParameter> paras, TransactionManager tm = null)
		{
			if (string.IsNullOrEmpty(set)) throw new ArgumentNullException("set");
			var sql = string.Format(@"UPDATE [dbo].[用户管理] SET {0} {1}", set, (string.IsNullOrEmpty(where) ? string.Empty : " WHERE " + where));
			return AdoBase(sql)
							.AddParameters(paras)
							.ExecuteNonQuery(tm);
		}
		#endregion

		#region Delete方法集合
		/// <summary>
		/// 按字段删除
		/// </summary>
		/// <param name="tm">事务管理对象</param>
		/// <param name = "iD"></param>
		public int DeleteByID(long iD, TransactionManager tm = null)
		{
			const string sql = @"DELETE FROM [dbo].[用户管理] WHERE [ID]=@ID";
			return AdoBase(sql)
							.AddInParameter("@ID", iD, DbType.Int64, 8)
							.ExecuteNonQuery(tm);
		}
		/// <summary>
		/// 按字段删除
		/// </summary>
		/// <param name="tm">事务管理对象</param>
		/// <param name = "coder用户"></param>
		public int DeleteByCoder用户(string coder用户, TransactionManager tm = null)
		{
			const string sql = @"DELETE FROM [dbo].[用户管理] WHERE [用户]=@用户";
			return AdoBase(sql)
							.AddInParameter("@用户", coder用户, DbType.AnsiString, 50)
							.ExecuteNonQuery(tm);
		}
		/// <summary>
		/// 按字段删除
		/// </summary>
		/// <param name="tm">事务管理对象</param>
		/// <param name = "coder密码"></param>
		public int DeleteByCoder密码(string coder密码, TransactionManager tm = null)
		{
			const string sql = @"DELETE FROM [dbo].[用户管理] WHERE [密码]=@密码";
			return AdoBase(sql)
							.AddInParameter("@密码", coder密码, DbType.AnsiString, 50)
							.ExecuteNonQuery(tm);
		}
		/// <summary>
		/// 按字段删除
		/// </summary>
		/// <param name="tm">事务管理对象</param>
		/// <param name = "coder省市"></param>
		public int DeleteByCoder省市(string coder省市, TransactionManager tm = null)
		{
			const string sql = @"DELETE FROM [dbo].[用户管理] WHERE [省市]=@省市";
			return AdoBase(sql)
							.AddInParameter("@省市", coder省市, DbType.AnsiString, 50)
							.ExecuteNonQuery(tm);
		}
		/// <summary>
		/// 按字段删除
		/// </summary>
		/// <param name="tm">事务管理对象</param>
		/// <param name = "coder地市"></param>
		public int DeleteByCoder地市(string coder地市, TransactionManager tm = null)
		{
			const string sql = @"DELETE FROM [dbo].[用户管理] WHERE [地市]=@地市";
			return AdoBase(sql)
							.AddInParameter("@地市", coder地市, DbType.AnsiString, 50)
							.ExecuteNonQuery(tm);
		}
		/// <summary>
		/// 按字段删除
		/// </summary>
		/// <param name="tm">事务管理对象</param>
		/// <param name = "coder县域"></param>
		public int DeleteByCoder县域(string coder县域, TransactionManager tm = null)
		{
			const string sql = @"DELETE FROM [dbo].[用户管理] WHERE [县域]=@县域";
			return AdoBase(sql)
							.AddInParameter("@县域", coder县域, DbType.AnsiString, 50)
							.ExecuteNonQuery(tm);
		}
		/// <summary>
		/// 按字段删除
		/// </summary>
		/// <param name="tm">事务管理对象</param>
		/// <param name = "coder站名"></param>
		public int DeleteByCoder站名(string coder站名, TransactionManager tm = null)
		{
			const string sql = @"DELETE FROM [dbo].[用户管理] WHERE [站名]=@站名";
			return AdoBase(sql)
							.AddInParameter("@站名", coder站名, DbType.AnsiString, 50)
							.ExecuteNonQuery(tm);
		}
		/// <summary>
		/// 按字段删除
		/// </summary>
		/// <param name="tm">事务管理对象</param>
		/// <param name = "coder站号"></param>
		public int DeleteByCoder站号(string coder站号, TransactionManager tm = null)
		{
			const string sql = @"DELETE FROM [dbo].[用户管理] WHERE [站号]=@站号";
			return AdoBase(sql)
							.AddInParameter("@站号", coder站号, DbType.AnsiString, 50)
							.ExecuteNonQuery(tm);
		}
		/// <summary>
		/// 按字段删除
		/// </summary>
		/// <param name="tm">事务管理对象</param>
		/// <param name = "coder东经"></param>
		public int DeleteByCoder东经(double? coder东经, TransactionManager tm = null)
		{
			const string sql = @"DELETE FROM [dbo].[用户管理] WHERE [东经]=@东经";
			return AdoBase(sql)
							.AddInParameter("@东经", coder东经.HasValue ? (object)coder东经.Value : DBNull.Value, DbType.Double, 8)
							.ExecuteNonQuery(tm);
		}
		/// <summary>
		/// 按字段删除
		/// </summary>
		/// <param name="tm">事务管理对象</param>
		/// <param name = "coder北纬"></param>
		public int DeleteByCoder北纬(double? coder北纬, TransactionManager tm = null)
		{
			const string sql = @"DELETE FROM [dbo].[用户管理] WHERE [北纬]=@北纬";
			return AdoBase(sql)
							.AddInParameter("@北纬", coder北纬.HasValue ? (object)coder北纬.Value : DBNull.Value, DbType.Double, 8)
							.ExecuteNonQuery(tm);
		}
		/// <summary>
		/// 按字段删除
		/// </summary>
		/// <param name="tm">事务管理对象</param>
		/// <param name = "coder高度"></param>
		public int DeleteByCoder高度(double? coder高度, TransactionManager tm = null)
		{
			const string sql = @"DELETE FROM [dbo].[用户管理] WHERE [高度]=@高度";
			return AdoBase(sql)
							.AddInParameter("@高度", coder高度.HasValue ? (object)coder高度.Value : DBNull.Value, DbType.Double, 8)
							.ExecuteNonQuery(tm);
		}
		/// <summary>
		/// 按字段删除
		/// </summary>
		/// <param name="tm">事务管理对象</param>
		/// <param name = "coder东经1"></param>
		public int DeleteByCoder东经1(double? coder东经1, TransactionManager tm = null)
		{
			const string sql = @"DELETE FROM [dbo].[用户管理] WHERE [东经1]=@东经1";
			return AdoBase(sql)
							.AddInParameter("@东经1", coder东经1.HasValue ? (object)coder东经1.Value : DBNull.Value, DbType.Double, 8)
							.ExecuteNonQuery(tm);
		}
		/// <summary>
		/// 按字段删除
		/// </summary>
		/// <param name="tm">事务管理对象</param>
		/// <param name = "coder北纬1"></param>
		public int DeleteByCoder北纬1(double? coder北纬1, TransactionManager tm = null)
		{
			const string sql = @"DELETE FROM [dbo].[用户管理] WHERE [北纬1]=@北纬1";
			return AdoBase(sql)
							.AddInParameter("@北纬1", coder北纬1.HasValue ? (object)coder北纬1.Value : DBNull.Value, DbType.Double, 8)
							.ExecuteNonQuery(tm);
		}
		/// <summary>
		/// 删除指定条件的记录
		/// </summary>
		/// <param name = "whereClause">自定义删除条件，where子句。如：id=1 and name='aaa'</param>
		/// <param name = "paras">where子句中定义的参数集合</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public int Delete(string whereClause, IEnumerable<DbParameter> paras, TransactionManager tm = null)
		{
			var sql = string.Format(@"DELETE FROM [dbo].[用户管理] {0}", (string.IsNullOrEmpty(whereClause) ? string.Empty : " WHERE " + whereClause));
			return AdoBase(sql)
							.AddParameters(paras)
							.ExecuteNonQuery(tm);
		}
		#endregion

		#region  自定义方法集合
		#endregion

	}


	#endregion
}
